layui.define([], function (exports) {
    var $ = layui.jquery,
        form = layui.form,
        tree = layui.tree,
        table = layui.table,
        layer = layui.layer,
        upload = layui.upload,
        laydate = layui.laydate,
        transfer = layui.transfer;

    //添加
    $('.addBtn').on('click', function () {
        var url = this.getAttribute('data-url');
        var width = this.getAttribute('data-width');
        var height = this.getAttribute('data-height');
        var params = this.getAttribute('data-param');
        if (isBlank(params)) {
            baseUtil.iframe('添加', url, width, height);
        } else {
            baseUtil.iframe('添加', url + '?' + params, width, height);
        }
        return false;
    });

    //删除
    $('.deleteBtn').on('click', function () {
        var url = this.getAttribute('data-url');
        var data = table.checkStatus('layuiTable').data;
        if (data.length === 0) {
            baseUtil.msg('请先选择对象');
        } else {
            var id = [];
            data.forEach(function (e) {
                id.push(e.id);
            });
            baseUtil.confirm('您确定要删除选中项?', '3', function () {
                baseUtil.doPostData(url, { id: id.join(',') }, function () {
                    table.reload('layuiTable', { where: {} });
                });
            });
        }
        return false;
    });

    //删除
    $('.deleteAllBtn').on('click', function () {
        var url = this.getAttribute('data-url');
        var data = table.checkStatus('layuiTable').data;
        var id = [];
        data.forEach(function (e) {
            id.push(e.id);
        });
        if (isEmpty(id)) {
            baseUtil.confirm('您确定要' + this.innerHTML + '所有项么?', '3', function () {
                baseUtil.doPostData(url, { id: id.join(',') }, function () {
                    table.reload('layuiTable', { where: {} });
                });
            });
        } else {
            baseUtil.confirm('您确定要' + this.innerHTML + '选中项么?', '3', function () {
                baseUtil.doPostData(url, { id: id.join(',') }, function () {
                    table.reload('layuiTable', { where: {} });
                });
            });
        }
        return false;
    });

    //导出
    form.on('submit(exportBtn)', function (data) {
        var url = this.getAttribute('data-url');
        var params = getObjectParams(data.field);
        document.location.href = url + params;
        return false;
    });

    //导入
    $('.importBtn').on('click', function () {
        var download = this.getAttribute('data-url-download');
        var importUrl = this.getAttribute('data-url-import');
        baseUtil.importExcel(download, importUrl);
        return false;
    });

    //搜索
    form.on('submit(searchBtn)', function (data) {
        table.reload('layuiTable', { where: data.field });
        return false;
    });

    //提交
    form.on('submit(submitBtn)', function (data) {
        var url = this.getAttribute('data-url');
        baseUtil.doPostData(url, data.field, function () {
            $('#submit').click();
        });
        return false;
    });

    //监听checkbox
    form.on('checkbox(' + name + ')', function (data) {
        var checkbox = $('input[name="' + name + '"]');
        var selectValue = checkbox.val();
        if (isBlank(selectValue)) {
            checkbox.val(data.value);
        } else {
            var selectValues = selectValue.split(',');
            selectValues.forEach(function (e, i) {
                if (e === data.value) {
                    selectValues.splice(i, i + 1);
                } else {
                    if (i === selectValues.length - 1) {
                        selectValues.push(data.value);
                    }
                }
            });
            checkbox.val(selectValues.sort().join(','));
        }
    });

    var baseUtil = {
        /**
         * AJAX请求
         */
        ajax: function (url, data, type, fn) {
            $.ajax({
                url: url, data: data, async: true, type: type, headers: { 'Authorization': "Bearer " + getAccessToken() }, success: function (result) {
                    // 权限
                    if (result.code === 403) {
                        requireLogin();
                    } else {
                        if (fn) fn(result);
                    }
                }
            });
        },
        /**
         * GET请求，返回Result，无加载效果
         */
        get: function (url, data, fn) {
            baseUtil.ajax(url, data, 'GET', function (result) {
                if (fn) fn(result);
            });
        },
        /**
         * GET请求，返回Data，无加载效果
         */
        getData: function (url, data, fn) {
            baseUtil.get(url, data, function (result) {
                if (result.code === 0) {
                    if (fn) fn(result.data);
                } else {
                    layer.msg(result.msg);
                }
            });
        },
        /**
         * GET请求，返回Result，有加载效果
         */
        doGet: function (url, data, fn) {
            var index = layer.load(2);
            baseUtil.get(url, data, function (result) {
                layer.close(index);
                if (fn) fn(result);
            });
        },
        /**
         * GET请求，返回Data，有加载效果
         */
        doGetData: function (url, data, fn) {
            baseUtil.doGet(url, data, function (result) {
                if (result.code === 0) {
                    if (fn) fn(result);
                } else {
                    layer.msg(result.msg);
                }
            });
        },
        /**
         * POST请求，返回Result，无加载效果
         */
        post: function (url, data, fn) {
            baseUtil.ajax(url, data, 'POST', function (result) {
                if (fn) fn(result);
            });
        },
        /**
         * POST请求，返回Data，无加载效果
         */
        postData: function (url, data, fn) {
            baseUtil.post(url, data, function (result) {
                if (result.code === 0) {
                    if (fn) fn(result.data);
                } else {
                    layer.msg(result.msg);
                }
            });
        },
        /**
         * POST请求，返回Result，有加载效果
         */
        doPost: function (url, data, fn) {
            var index = layer.load(2);
            baseUtil.post(url, data, function (result) {
                layer.close(index);
                if (fn) fn(result);
            });
        },
        /**
         * POST请求，返回Data，有加载效果
         */
        doPostData: function (url, data, fn) {
            baseUtil.doPost(url, data, function (result) {
                if (result.code === 0) {
                    if (fn) fn(result);
                } else {
                    layer.msg(result.msg);
                }
            });
        },
        /**
         * 初始化字典码
         */
        initDict: function (dictCode, fn) {
            baseUtil.doPostData('/system/dictcontent/findListByCache.do', { dictCode: dictCode }, function (data) {
                if (fn) fn(data);
            });
        },
        /**
         * 初始化下拉框
         */
        initSelect: function (dictContent, dictCode, selectType, selectValue) {
            var obj = $('select[id=' + dictCode + ']');
            obj.html('');
            if (selectType === '1') {
                obj.append('<option value=\'\'>全部</option>');
            } else if (selectType === '2') {
                obj.append('<option value=\'\'>请选择</option>');
            }
            var data = baseUtil.initDictContent(dictContent, dictCode);
            if (isBlank(selectValue)) {
                data.forEach(function (e) {
                    obj.append('<option value=\'' + e.value + '\'>' + e.name + '</option>');
                });
            } else {
                data.forEach(function (e) {
                    if (selectValue === e.value) {
                        obj.append('<option selected value=\'' + e.value + '\'>' + e.name + '</option>');
                    } else {
                        obj.append('<option value=\'' + e.value + '\'>' + e.name + '</option>');
                    }
                });
            }
            form.render('select');
        },
        /**
         * 获取字典内容
         */
        initDictContent: function (dictContent, dictCode) {
            var data = [];
            dictContent.forEach(function (e) {
                if (e.dictCode === dictCode) {
                    data.push(e);
                }
            });
            return data;
        },
        /**
         * 显示字典内容
         */
        showDictContent: function (dictContent, dictCode, selectValue) {
            if (isBlank(selectValue)) {
                return '';
            }
            var name = [];
            var values = selectValue.split(',');
            values.forEach(function (e) {
                for (var i = 0; i < dictContent.length; i++) {
                    if (dictContent[i].dictCode === dictCode && dictContent[i].value === e) {
                        name.push(dictContent[i].name);
                        break;
                    }
                }
            });
            return name.join(',');
        },
        /**
         * 初始化表格
         */
        initTable: function (url, cols, fn, height) {
            table.render({
                elem: '#layuiTable',
                url: url,
                method: 'post',
                headers: { 'token': getAccessToken() },
                cols: [cols],
                height: isBlank(height) ? 'full-110' : 'full-' + height,
                response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'pageTotal', dataName: 'data' },
                done: function (result) {
                    if (result.code === 2) {
                        requireLogin();
                    }
                }
            });
            if (cols[cols.length - 1].hasOwnProperty('toolbar')) {
                baseUtil.initTableListener(function (obj, url) {
                    if (fn) fn(obj, url);
                });
            } else {
                if (fn) fn();
            }
        },
        /**
         * 初始化分页
         */
        initPage: function (url, cols, fn, height) {
            table.render({
                elem: '#layuiTable',
                url: url,
                method: 'post',
                headers: { 'token': getAccessToken() },
                cols: [cols],
                height: isBlank(height) ? 'full-110' : 'full-' + height,
                page: {
                    layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
                    limit: 20,
                    limits: [20, 50, 100],
                    curr: 1,
                    groups: 5,
                    first: '首页',
                    last: '末页'
                },
                request: { pageName: 'pageNum', limitName: 'pageSize' },
                response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'pageTotal', dataName: 'data' },
                done: function (result) {
                    if (result.code === 2) {
                        requireLogin();
                    }
                }
            });
            if (cols[cols.length - 1].hasOwnProperty('toolbar')) {
                baseUtil.initTableListener(function (obj, url) {
                    if (fn) fn(obj, url);
                });
            } else {
                if (fn) fn();
            }
        },
        /**
         * 初始化分页监听
         */
        initTableListener: function (fn) {
            table.on('tool(tableTool)', function (obj) {
                var event = obj.event;
                var id = obj.data.id;
                var url = this.getAttribute('data-url');
                if (event === 'edit') {
                    var title = this.getAttribute('data-title');
                    var width = this.getAttribute('data-width');
                    var height = this.getAttribute('data-height');
                    if (isBlank(title)) {
                        title = '编辑';
                    }
                    baseUtil.iframe(title, url + '?id=' + id, width, height);
                } else if (event === 'delete') {
                    baseUtil.confirm('您确定要删除选中项?', '3', function () {
                        baseUtil.doPostData(url, { id: id }, function () {
                            table.reload('layuiTable', { where: {} });
                        });
                    });
                } else if (event.indexOf('addBy') > -1) {
                    var params = event.substring(5, event.length).split('And');
                    for (var i = 0; i < params.length; i++) {
                        var param = params[i].substring(0, 1).toLowerCase() + params[i].substring(1, params[i].length);
                        if (i === 0) {
                            url += '?' + param + '=' + obj.data[param];
                        } else {
                            url += '&' + param + '=' + obj.data[param];
                        }
                    }
                    parent.tabChange(url.split('?')[0], this.getAttribute('data-title'), url);
                } else if (event === 'showPicture') {
                    baseUtil.doPostData('/system/file/findList.do', { objectId: obj.data[this.id] }, function (data) {
                        if (isNotEmpty(data)) {
                            var path = '/system/file/showFile.do?filePath=' + data[0].filePath;
                            layer.photos({
                                photos: { title: '', id: '', start: 0, data: [{ pid: data[0].id, alt: data[0].fileName, src: path, thumb: path }] },
                                anim: 0
                            });
                        }
                    });
                } else if (event === 'downloadFile') {
                    document.location.href = '/system/file/downloadFile.do?id=' + id;
                    return false;
                } else {
                    if (fn) fn(obj, url);
                }
            });
        },
        /**
         * 初始化表单数据
         */
        initFormData: function (url, params, cols, fn) {
            baseUtil.doPostData(url, params, function (data) {
                for (var i = 0; i < cols.length; i++) {
                    var name = cols[i].name;
                    var type = cols[i].type;
                    if (type === 'select') {
                        var selectType = '2';
                        if (cols[i].hasOwnProperty('selectType')) {
                            selectType = cols[i].selectType;
                        }
                        if (isBlank(cols[i].code)) {
                            if (isBlank(data[name])) {
                                baseUtil.initSelect(cols[i].dictContent, name, selectType, cols[i].selectValue);
                            } else {
                                baseUtil.initSelect(cols[i].dictContent, name, selectType, data[name]);
                            }
                        } else {
                            if (isBlank(data[name])) {
                                baseUtil.initSelect(cols[i].dictContent, cols[i].code, selectType, cols[i].selectValue);
                            } else {
                                baseUtil.initSelect(cols[i].dictContent, cols[i].code, selectType, data[name]);
                            }
                        }
                    } else {
                        if (isNotBlank(data[name])) {
                            if (type === 'input') {
                                $('input[name=' + name + ']').val(data[name]);
                            } else if (type === 'textarea') {
                                $('textarea[name=' + name + ']').val(data[name]);
                            } else if (type === 'datetime') {
                                baseUtil.initDateTime(name, cols[i].dateType, data[name], cols[i].dateFormat);
                            } else if (type === 'checkbox') {
                                $('input[name=' + name + ']').val(data[name]);
                                var values = data[name].split(',');
                                var checkbox = $('input[lay-filter="' + name + '"]');
                                for (var j = 0; j < values.length; j++) {
                                    for (var k = 0; k < checkbox.length; k++) {
                                        if (values[j] === $(checkbox[k]).val()) {
                                            $(checkbox[k]).attr('checked', 'checked');
                                            break;
                                        }
                                    }
                                }
                                form.render('checkbox');
                            } else if (type === 'radio') {
                                var radio = $('input[name=' + name + ']');
                                for (var j = 0; j < radio.length; j++) {
                                    if ($(radio[j]).val() === data[name]) {
                                        $(radio[j]).attr('checked', true);
                                    } else {
                                        $(radio[j]).attr('checked', false);
                                    }
                                }
                                form.render('radio');
                            }
                        }
                    }
                }
                if (fn) fn(data);
            });
        },
        msg: function (content, icon, fn) {
            var params = {};
            if (isNotBlank(icon)) {
                params.icon = icon;
            }
            layer.msg(content, params, function () {
                if (fn) fn();
            });
        },
        alert: function (content, icon, fn) {
            var params = { title: '提示', resize: false, closeBtn: 0 };
            if (isNotBlank(icon)) {
                params.icon = icon;
            }
            layer.alert(content, params, function (index) {
                if (fn) fn();
                layer.close(index);
            });
        },
        confirm: function (content, icon, fn) {
            var params = { title: '提示', resize: false, closeBtn: 0 };
            if (isNotBlank(icon)) {
                params.icon = icon;
            }
            layer.confirm(content, params, function (index) {
                if (fn) fn();
                layer.close(index);
            });
        },
        iframe: function (title, url, width, height) {
            width = isBlank(width) ? '776' : width;
            layer.open({
                type: 2,
                title: title,
                content: url,
                area: isBlank(height) ? (width + 'px') : [width + 'px', height + 'px'],
                fixed: false,
                maxmin: false,
                resize: false,
                scrollbar: false,
                success: function (layero, index) {
                    if (isBlank(height)) {
                        layer.iframeAuto(index);
                        layer.style(index, { top: (layui.$(window).height() - layui.$(layero).height()) / 2 + $(window).scrollTop() });
                    }
                    var body = layer.getChildFrame('body', index);
                    body.find('#submit').bind('click', function () {
                        layer.close(index);
                        window.location.reload();
                    });
                    body.find('#cancel').bind('click', function () {
                        layer.close(index);
                    });
                }
            });
        },
        prompt: function (title, content, fn1, fn2) {
            layer.open({
                type: 1,
                title: title,
                content: content,
                closeBtn: 0,
                btnAlign: 'c',
                resize: false,
                skin: 'layui-layer-prompt',
                btn: ['确定', '取消'],
                success: function (layero, index) {
                    if (fn1) fn1(layero, index);
                },
                btn1: function (index) {
                    if (fn2) fn2(layer, index);
                },
                btn2: function (index) {
                    layer.close(index);
                }
            });
        },
        importExcel: function (downloadUrl, importUrl) {
            var content = '';
            content += '<div class="layui-upload" style="padding: 50px 50px">';
            content += '<div class="layui-form-item">';
            content += '<div class="layui-inline" style="width: 485px"><input class="layui-input layui-upload-choose" placeholder="未选择任何文件" readonly></div>';
            content += '<div class="layui-inline"><button type="button" class="layui-btn" id="selectFile">选择文件</button></div>';
            content += '</div>';
            content += '<div class="layui-form-item" style="text-align: center">';
            content += '<div class="layui-inline" style="margin-right: 10px"><button type="button" class="layui-btn" id="downloadFile">下载模板</button></div>';
            content += '<div class="layui-inline"><button type="button" class="layui-btn" id="uploadFile">开始上传</button></div>';
            content += '</div>';
            content += '</div>';
            layer.open({
                type: 1,
                title: '导入数据',
                area: '700px',
                resize: false,
                content: content,
                success: function () {
                    $('#downloadFile').bind('click', function () {
                        document.location.href = downloadUrl;
                    });
                    var index;
                    upload.render({
                        elem: '#selectFile',
                        url: importUrl,
                        accept: 'file',
                        acceptMime: '.xls,.xlsx',
                        auto: false,
                        bindAction: '#uploadFile',
                        headers: { token: getAccessToken() },
                        choose: function (obj) {
                            obj.preview(function (index, file) {
                                $('.layui-upload-choose').val(file.name);
                            });
                        },
                        before: function () {
                            index = layer.load(2);
                        },
                        done: function (result) {
                            if (result.code === 0) {
                                layer.closeAll();
                                baseUtil.alert('上传成功！', '1', function (index2) {
                                    layer.close(index2);
                                    table.reload('layuiTable', { where: {} });
                                });
                            } else if (result.code === 1) {
                                layer.close(index);
                                baseUtil.alert(result.msg, '2', function (index2) {
                                    layer.close(index2);
                                });
                            } else if (result.code === 2) {
                                requireLogin();
                            }
                        },
                        error: function () {
                            layer.close(index);
                            baseUtil.alert('上传失败，请重新试试！', '2', function (index2) {
                                layer.close(index2);
                            });
                        }
                    });
                }
            });
        },
        initMultiSelect: function (id, name, title, url, fn, parseData) {
            var input = $('input[name="' + id + '"]');
            var value = isBlank(input.val()) ? [] : input.val().split(',');
            layer.open({
                type: 1,
                title: title + '选择器',
                content: '<div id="transferElem"></div>',
                area: ['716px', '530px'],
                closeBtn: 0,
                resize: false,
                btnAlign: 'c',
                skin: 'layui-layer-prompt',
                btn: ['确定', '取消'],
                success: function () {
                    baseUtil.doPost(url, {}, function (result) {
                        var data = [];
                        if (result.code === 0) {
                            data = result.data;
                        }
                        transfer.render({
                            id: 'transferId',
                            elem: '#transferElem',
                            title: ['未选择', '已选择'],
                            data: data,
                            value: value,
                            width: 300,
                            height: 390,
                            showSearch: true,
                            parseData: function (res) {
                                if (isNotBlank(parseData)) {
                                    return {
                                        'value': res[parseData.split(',')[0]],
                                        'title': res[parseData.split(',')[1]],
                                        'disabled': res.disabled,
                                        'checked': res.checked
                                    }
                                } else {
                                    return {
                                        'value': res.id,
                                        'title': res.name,
                                        'disabled': res.disabled,
                                        'checked': res.checked
                                    }
                                }
                            }
                        });
                    });
                },
                btn1: function (index) {
                    var data = transfer.getData('transferId');
                    var ids = [];
                    var names = [];
                    for (var i = 0; i < data.length; i++) {
                        ids.push(data[i].value);
                        names.push(data[i].title);
                    }
                    $('input[name="' + id + '"]').val(ids.join(','));
                    $('input[name="' + name + '"]').val(names.join(','));
                    if (fn) fn(ids.join(','), names.join(','));
                    layer.close(index);
                },
                btn2: function (index) {
                    layer.close(index);
                }
            });
        },
        initTreeMultiSelect: function (id, name, title, treeUrl, dataUrl, fn) {
            var params = { id: id, name: name, treeUrl: treeUrl, dataUrl: dataUrl, ids: $('input[name=' + id + ']').val() };
            layer.open({
                type: 2,
                title: title + '选择器',
                content: '/common/selector/multiSelectorTree.html?params=' + encodeURI(JSON.stringify(params)),
                area: ['1000px', '570px'],
                fixed: false,
                maxmin: false,
                resize: false,
                success: function (layero, index) {
                    var body = layer.getChildFrame('body', index);
                    body.find('#submit').bind('click', function () {
                        var input = $(body.find('.layui-transfer-box')[1]).find('input[name="layTransferLeftCheck"]');
                        if (input.length === 0) {
                            baseUtil.msg('请选择' + title + '！');
                            return false;
                        } else {
                            var ids = [];
                            var names = [];
                            input.each(function (i, e) {
                                ids.push(e.value);
                                names.push(e.title);
                            });
                            if (fn) {
                                fn(ids, names);
                            } else {
                                $('input[name="' + id + '"]').val(ids.join(','));
                                $('textarea[name="' + name + '"]').val(names.join(','));
                            }
                            layer.close(index);
                        }
                    });
                    body.find('#cancel').bind('click', function () {
                        layer.close(index);
                    });
                }
            });
        },
        /**
         * 初始化时间控件
         */
        initDateTime: function (elem, type, value, format) {
            if (type === 'year') {
                format = 'yyyy';
            } else if (type === 'month') {
                format = 'yyyy-MM';
            } else if (type === 'date') {
                format = 'yyyy-MM-dd';
            } else if (type === 'time') {
                if (isBlank(format)) {
                    format = 'HH:mm:ss';
                }
            } else if (type === 'datetime') {
                if (isBlank(format)) {
                    format = 'yyyy-MM-dd HH:mm:ss';
                }
            }
            laydate.render({ elem: '#' + elem, type: type, format: format, btns: ['confirm'], calendar: true });
            if (isNotBlank(value)) {
                $('#' + elem).val(value);
            }
        },
        /**
         * 初始化dTree
         */
        initDTree: function (elem, url, checkbar, selectObj, checkbarType) {
            layui.use(['dtree'], function () {
                var dtree = layui.dtree;

                if (isBlank(checkbarType)) {
                    checkbarType = 'all';
                }
                dtree.render({
                    elem: elem,
                    url: url,
                    headers: { 'token': getAccessToken() },
                    dataStyle: 'layuiStyle',
                    dataFormat: 'list',
                    response: { statusName: 'code', message: 'msg', statusCode: 0 },
                    checkbar: checkbar,
                    checkbarData: 'choose',
                    checkbarType: checkbarType,
                    type: 'all',
                    initLevel: '3',
                    ficon: 0,
                    icon: 5,
                    dot: false,
                    load: true,
                    cache: true,
                    done: function (result) {
                        if (result.code === 0) {
                            var value = [];
                            for (var i = 0; i < result.data.length; i++) {
                                if (result.data[i].checkArr[0].isChecked === '1') {
                                    value.push(result.data[i].id);
                                }
                            }
                            $('input[name=' + selectObj + ']').val(value.join(','));
                        } else if (result.code === 2) {
                            requireLogin();
                        }
                    },
                    checkbarFun: {
                        chooseDone: function (checkbarNodesParam) {
                            var value = [];
                            for (var i = 0; i < checkbarNodesParam.length; i++) {
                                value.push(checkbarNodesParam[i].nodeId);
                            }
                            $('input[name=' + selectObj + ']').val(value.join(','));
                        }
                    }
                });
            });
        },
        /**
         * 初始化tree
         */
        initTree: function (id, url, fn) {
            baseUtil.doPostData(url, {}, function (data) {
                tree.render({
                    id: id,
                    elem: '#' + id,
                    data: data,
                    onlyIconControl: true,
                    text: {
                        none: '暂无数据'
                    },
                    click: function (obj) {
                        if (fn) fn(obj, baseUtil.getAllChildId(obj.data).join(','));
                    }
                });
                if (isEmpty(data)) {
                    $('.layui-tree-emptyText').attr('style', 'padding-top:390px');
                }
            });
        },
        getAllChildId: function (data) {
            var ids = [];
            ids.push(data.id);
            if (isNotEmpty(data.children)) {
                data.children.forEach(function (e) {
                    ids.push(baseUtil.getAllChildId(e));
                });
            }
            return ids;
        },
        initTreeSelect: function (elem, id, url) {
            baseUtil.doPostData(url, {}, function (data) {
                tree.render({
                    elem: '#' + elem,
                    data: data,
                    click: function (node) {
                        var $select = $($(this)[0].elem).parents('.layui-form-select');
                        $select.removeClass('layui-form-selected').find('.layui-select-title span').html(node.data.title).end().find('input:hidden[name=' + id + ']').val(node.data.id);
                    }
                });

                $('.downpanel').on('click', '.layui-select-title', function (e) {
                    $('.layui-form-select').not($(this).parents('.layui-form-select')).removeClass('layui-form-selected');
                    $(this).parents('.downpanel').toggleClass('layui-form-selected');
                    layui.stope(e);
                }).on('click', 'dl i', function (e) {
                    layui.stope(e);
                });

                $(document).on('click', function () {
                    $('.layui-form-select').removeClass('layui-form-selected');
                });
            });
        }
    };
    exports('baseUtil', baseUtil);
});
